require 'alta_bikes'
require 'pry'
require 'ostruct'
require 'simplecov'
require 'vcr'

SimpleCov.start

RSpec.configure do |config|
  begin
    config.filter_run :focus
    config.run_all_when_everything_filtered = true

    if config.files_to_run.one?
      config.default_formatter = 'doc'
    else
      config.default_formatter = 'NyanCatFormatter'
    end

    config.order = :random

    Kernel.srand config.seed

    config.expect_with :rspec do |expectations|
      expectations.syntax = :expect
    end

    config.mock_with :rspec do |mocks|
      mocks.syntax = :expect
      mocks.verify_partial_doubles = true
    end

    VCR.configure do |c|
      c.cassette_library_dir = 'spec/cassettes'
      c.hook_into :webmock
      c.allow_http_connections_when_no_cassette = true
      c.default_cassette_options = { :match_requests_on => [:path] }
      c.default_cassette_options = { :record => :new_episodes }
      #c.default_cassette_options = { :record => :all }
      #c.debug_logger = $stderr
    end
  end
end
